package com.sora.sora.common.model.entity;

import com.sora.sora.common.model.param.ArticleParam;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ArticleEntity {

    private int id;

    private String author;

    private String title;

    private String content;

    private Date uploadTime;

    private int view;

    private int like;

    private int collection;

    private Integer isDeleted;

    public ArticleEntity(ArticleParam param) {
        this.author = param.getAuthor();
        this.title = param.getTitle();
        this.content = param.getContent();
        this.uploadTime = new Date();
    }
}
